//
//  SRClient.h
//  mall
//
//  Created by 一米阳光 on 15/7/29.
//  Copyright (c) 2015年 seekool. All rights reserved.
//
typedef void (^SRAPIResponseBLock)(NSURLSessionDataTask *task, id responseObject, NSError *error);

typedef NS_ENUM(NSInteger, LTErrorCode){//FIXME:LTErrorCodeBadRequest和服务器返回的code冲突  服务器返回有为1的情况  将LTErrorCodeBadRequest改成其他值
    LTErrorCodeNetworkError   =      -1,
    LTErrorCodeBadRequest     =       1
};

extern NSString *const LTErrorInnerErrorKey;

@interface SRClient : NSObject

+ (instancetype) sharedClient;

- (NSURLSessionDataTask *) POST:(NSString *)api parameters:(NSDictionary *)parameters completion:(SRAPIResponseBLock) completion;
- (RACSignal *)signalWithAPI:(NSString *)api parameters:(NSDictionary *)parameters;

@end
